
import type { ApiResponse } from "@/common/type"

export interface CouponSelectVO {
    id: number,
    name: string,
    type: number,
    value: number,
    total: number,
    used: number,
    minPrice: number,
    status: number,
    order: number,
    desc: string,
    startTime: string,
    endTime: string,
    createTime: string,
    updateTime: string,
    createManagerId: number,
    lastUpdateManagerId: number
}

export interface CouponPageVO {
    total:number,
    records: CouponSelectVO[]
}

export interface CouponAddForm {
    name: string,
    type: number,
    value: number,
    total: number,
    used: number,
    minPrice: number,
    status: number,
    order: number,
    desc: string,
    startTime: string,
    endTime: string,
}

export interface CouponEditForm {
    id: number,
    name: string,
    type: number,
    value: number,
    total: number,
    used: number,
    minPrice: number,
    status: number,
    order: number,
    desc: string,
    startTime: string,
    endTime: string,
}

export type CouponApi={
    page: (page: number, size: number) => Promise<ApiResponse<CouponPageVO>>,
    add:(form: CouponAddForm) => Promise<ApiResponse<null>>,
    update:(form: CouponEditForm) => Promise<ApiResponse<null>>,
    delete:(ids: number[]) => Promise<ApiResponse<null>>,
}